<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>data的两种写法</title>
    <script type="text/javascript" src="../js/vue.js"></script>
    <script type="text/javascript">
      Vue.config.productionTip = false;
    </script>
  </head>
  <body>
    <div id="root">
      姓：<input type="text" v-model="firstName" />
      <br />
      名：<input type="text" v-model="lastName" />
      <br />
      <!--表达式拼接的方式，后续可能很臃肿，不利于扩展-->
      全名：<span>{{firstName}}-{{lastName}}</span>
    </div>
  </body>

  <script type="text/javascript">
    //VM  Vue实例，中转站
    const vm = new Vue({
      el: "#root",
      data: {
        firstName: "张",
        lastName: "三",
      },
    });
  </script>
</html>
